﻿using System.Runtime.Serialization;
using System;

    /// <summary>
    /// Provides information about parity
    /// </summary>
    public class OptionInfo : IIdentifiable, ICloneable
    {
        /// <summary>
        /// Gets or sets the option ID.
        /// </summary>
        /// <value>The option ID.</value>
        public int OptionID
        {
            get;
            set;
        }

        /// <summary>
        /// Gets the id.
        /// </summary>
        /// <value>The id.</value>
        object IIdentifiable.Id
        {
            get { return OptionID; }
        }

        /// <summary>
        /// Gets or sets the instrument ID.
        /// </summary>
        /// <value>The instrument ID.</value>
        public int InstrumentID
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the instrument expiry time.
        /// </summary>
        /// <value>instrument expiry time.</value>
        public DateTime ExpireInstrument
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the LotSize.
        /// </summary>
        /// <value>The LotSize.</value>
        public int LotSize
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the BuyMargin.
        /// </summary>
        /// <value>The BuyMargin.</value>
        public decimal BuyMargin
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the SellMargin.
        /// </summary>
        /// <value>The SellMargin.</value>
        public decimal SellMargin
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the BuyFee.
        /// </summary>
        /// <value>The BuyFee.</value>
        public decimal BuyFee
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the SellFee.
        /// </summary>
        /// <value>The SellFee.</value>
        public decimal SellFee
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the BuyCommission.
        /// </summary>
        /// <value>The BuyCommission.</value>
        public decimal BuyCommission
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the SellCommission.
        /// </summary>
        /// <value>The SellCommission.</value>
        public decimal SellCommission
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the TradableCount.
        /// </summary>
        /// <value>The TradableCount.</value>
        public int TradableCount
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the NonTradableCount.
        /// </summary>
        /// <value>The NonTradableCount.</value>
        public int NonTradableCount
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the ExpiryMonths.
        /// </summary>
        /// <value>The ExpiryMonths.</value>
        public int ExpiryMonths
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the LastTradingDay.
        /// </summary>
        /// <value>The LastTradingDay.</value>
        public int LastTradingDay
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the IsOpenSellAllowed.
        /// </summary>
        /// <value>The IsOpenSellAllowed.</value>
        public bool IsOpenSellAllowed
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the ExpiryMethodID.
        /// </summary>
        /// <value>The ExpiryMethodID.</value>
        public int ExpiryMethodID
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the TradingDays.
        /// </summary>
        /// <value>The TradingDays.</value>
        public int TradingDays
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the TradingDayStart.
        /// </summary>
        /// <value>The TradingDayStart.</value>
        public DateTime TradingDayStart
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the TradingDayEnd.
        /// </summary>
        /// <value>The TradingDayEnd.</value>
        public DateTime TradingDayEnd
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the CategoryID.
        /// </summary>
        /// <value>The CategoryID.</value>
        public int CategoryID
        {
            get;
            set;
        }


        /// <summary>
        /// Gets or sets the EnableTrading.
        /// </summary>
        /// <value>The EnableTrading.</value>
        public bool EnableTrading
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the CreationDate.
        /// </summary>
        /// <value>The CreationDate.</value>
        public DateTime CreationDate
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the ExpiryDays.
        /// </summary>
        /// <value>The ExpiryDays.</value>
        public int ExpiryDays
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the ExpiryTime.
        /// </summary>
        /// <value>The ExpiryTime.</value>
        public DateTime ExpiryTime
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the ExpiryWeek.
        /// </summary>
        /// <value>The ExpiryWeek.</value>
        public int ExpiryWeek
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the symbol.
        /// </summary>
        /// <value>The symbol.</value>
        public string Symbol
        {
            get;
            set;
        }

        /// <summary>
        /// InterestRate
        /// </summary>
        public double InterestRate
        {
            get;
            set;
        }

        /// <summary>
        /// ForeignRate
        /// </summary>
        public double ForeignRate
        {
            get;
            set;
        }

        /// <summary>
        /// CruxFactor
        /// </summary>
        public double CruxFactor
        {
            get;
            set;
        }

        /// <summary>
        /// AtmVolatility
        /// </summary>
        public double AtmVolatility
        {
            get;
            set;
        }

        /// <summary>
        /// LowerSlope
        /// </summary>
        public double LowerSlope
        {
            get;
            set;
        }

        /// <summary>
        /// LowerCurve
        /// </summary>
        public double LowerCurve
        {
            get;
            set;
        }

        /// <summary>
        /// UpperSlope
        /// </summary>
        public double UpperSlope
        {
            get;
            set;
        }

        /// <summary>
        /// UpperCurve
        /// </summary>
        public double UpperCurve
        {
            get;
            set;
        }

        /// <summary>
        /// SpreadFactor
        /// </summary>
        public double SpreadFactor
        {
            get;
            set;
        }

        /// <summary>
        /// StrikeInstrument
        /// </summary>
        public double StrikeIncrement
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the trading period.
        /// </summary>
        public int TradingPeriod
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the market ID.
        /// </summary>
        public int MarketID
        {
            get;
            set;
        }

        /// <summary>
        /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
        /// </returns>
        public override string ToString()
        {
            return Symbol;
        }

        #region ICloneable Members

        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public object Clone()
        {
            return this.MemberwiseClone();
        }

        #endregion
    }


    /// <summary>
    /// IIdentifiable mean the object has Property Id- Uniuqe Identifier
    /// </summary>
    public interface IIdentifiable
    {
        /// <summary>
        /// Gets the id.
        /// </summary>
        /// <value>The id.</value>
        object Id { get; }
    }

    /// <summary>
    /// Side of order.
    /// </summary>
    public enum Side
    {
        /// <summary>
        /// Buy side.
        /// </summary>
        Buy,

        /// <summary>
        /// Sell side.
        /// </summary>
        Sell
    }
